diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-03-06 11:59:03 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-03-06 11:59:03 +0700 |
| commit | 78d02a2392924d5d4a21206fb52f627251883af8 (patch) | |
| tree | b1cda7f12961508065b5ddedcfa757ea6ec0ff4e /src/pages/shop/checkout/[status].jsx | |
| parent | 66f1fb98cf450c98fca14fd76809ff99c52533e6 (diff) | |
fix
Diffstat (limited to 'src/pages/shop/checkout/[status].jsx')
| -rw-r--r-- | src/pages/shop/checkout/[status].jsx | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/pages/shop/checkout/[status].jsx b/src/pages/shop/checkout/[status].jsx new file mode 100644 index 00000000..bf184c0e --- /dev/null +++ b/src/pages/shop/checkout/[status].jsx @@ -0,0 +1,27 @@ +import BasicLayout from '@/core/components/layouts/BasicLayout' +import IsAuth from '@/lib/auth/components/IsAuth' +import FinishCheckoutComponent from '@/lib/checkout/components/FinishCheckout' +import { useRouter } from 'next/router' +import axios from 'axios' + +export async function getServerSideProps(context) { + const { order_id } = context.query + await axios.post( + `${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/finish-checkout?orderName=${order_id}`, + {}, + { headers: context.req.headers } + ) + return { props: {} } +} + +export default function Finish() { + const router = useRouter() + + return ( + <IsAuth> + <BasicLayout> + <FinishCheckoutComponent query={router.query || {}} /> + </BasicLayout> + </IsAuth> + ) +} |
